package com.mes.biz.service.impl;

import java.util.List;

import com.mes.common.core.domain.BaseEntity;
import com.mes.common.core.service.BaseServiceImpl;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.mes.biz.mapper.BizReceiveOrderDetailMapper;
import com.mes.biz.domain.BizReceiveOrderDetail;
import com.mes.biz.service.BizReceiveOrderDetailService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 领用出库单明细Service业务层处理
 * @author wy
 * @email wy
 * @date 2023-06-16
 */
@Service
@Transactional(readOnly = true)
public class BizReceiveOrderDetailServiceImpl extends BaseServiceImpl<BizReceiveOrderDetailMapper, BizReceiveOrderDetail> implements BizReceiveOrderDetailService {

    private static final Logger log = LoggerFactory.getLogger(BizReceiveOrderDetailServiceImpl.class);

    /**
     * 获取单条数据
     * @param bizReceiveOrderDetail 领用出库单明细
     * @return 领用出库单明细
     */
    @Override
    public BizReceiveOrderDetail get(BizReceiveOrderDetail bizReceiveOrderDetail) {
        BizReceiveOrderDetail dto = super.get(bizReceiveOrderDetail);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 领用出库单明细id
     * @return 领用出库单明细
     */
    @Override
    public BizReceiveOrderDetail get(String id) {
        BizReceiveOrderDetail dto = super.get(id);
        return dto;
    }

    /**
     * 查询领用出库单明细列表
     * @param bizReceiveOrderDetail 领用出库单明细
     * @return 领用出库单明细
     */
    @Override
    public List<BizReceiveOrderDetail> findList(BizReceiveOrderDetail bizReceiveOrderDetail) {
		List<BizReceiveOrderDetail> bizReceiveOrderDetailList = super.findList(bizReceiveOrderDetail);
        return bizReceiveOrderDetailList;
    }

    /**
     * 分页查询领用出库单明细列表
     * @param bizReceiveOrderDetail 领用出库单明细
     * @return 领用出库单明细
     */
    @Override
    public PageInfo<BizReceiveOrderDetail> findPage(BizReceiveOrderDetail bizReceiveOrderDetail) {
		PageInfo<BizReceiveOrderDetail> page = super.findPage(bizReceiveOrderDetail);
        return page;
    }

    /**
     * 保存领用出库单明细
     * @param bizReceiveOrderDetail
     * @return 结果
     */
    @Override
    public boolean save(BizReceiveOrderDetail bizReceiveOrderDetail) {
        return super.save(bizReceiveOrderDetail);
    }

    /**
     * 删除领用出库单明细信息
     * @param bizReceiveOrderDetail
     * @return 结果
     */
    @Override
    public boolean remove(BizReceiveOrderDetail bizReceiveOrderDetail) {
        return super.remove(bizReceiveOrderDetail);
    }

    /**
     * 批量删除领用出库单明细
     * @param ids 需要删除的领用出库单明细ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteBizReceiveOrderDetailByIds(String[] ids) {
        return mapper.deleteBizReceiveOrderDetailByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

    @Transactional(readOnly = false)
    @Override
    public int deleteReceiveOrderDetailByReceiveOrderId(String id) {
        return mapper.deleteReceiveOrderDetailByReceiveOrderId(id,BaseEntity.DEL_FLAG_DELETE);
    }

}
